package com.ericsson.rm.dao;

import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.ericsson.rm.model.ResourceSkillDetail;

@Repository
public class ResourceSkillDaoImpl implements ResourceSkillDao {
	
	@Autowired
	EntityManagerFactory factory;

	@SuppressWarnings("unchecked")
	@Override
	public List<String> fetchResourceIdBySkillId(String skillId) {
		EntityManager entity = factory.createEntityManager();
		Query q = entity.createNamedQuery("ResourceSkillDetail.findResourceId",ResourceSkillDetail.class);		
		return q.getResultList();
	}

}
